const state = {
  name: "",
  age: "",
  avatar: "",
  password:"",
  powerLevel:''
};

const mutations = {

  SET_NAME: (state, name) => {
    state.name = name;
  },
  SET_AGE: (state, age) => {
    state.age = age;
  },
  SET_AVATAR: (state, avatar) => {
    state.avatar = avatar;
  },
  SET_PASSWORD:(state, password) =>{
    state.password = password
  },
  SET_POWER:(state,power) =>{
    state.powerLevel = power
  },
};
const actions = {
  setName({ commit }, name) {
    commit("SET_NAME", name);
  },
  setAge({ commit }, age) {
    commit("SET_AGE", age);
  },

  setAvatar({ commit }, avatar) {
    commit("SET_AVATAR", avatar);
  },
  setPassword ({commit} , avatar){
    commit("SET_PASSWORD", avatar);
  },
  setPower ({commit} , avatar){
    commit("SET_POWER", avatar);
  },
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}
